<include file="Index/header" />

<div class="container">
	<nav class="navbar navbar-default" role="navigation">
		<div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
			<ul class="nav navbar-nav">
				<!-- <li><a href="?m=admin&c=user&a=add" class="glyphicon glyphicon-plus">新增会员</a></li> -->
			</ul>
			<form class="navbar-form navbar-right" action="?m=admin&c=goods&a=query" method="post" role="search"
				onsubmit="return query()">
				<div class="form-group">
					<input type="text" class="form-control" placeholder="会员名称" id="name" name="user_name" />
				</div> <button type="submit" class="btn btn-default">搜索</button>
			</form>
		</div>
	</nav>
	<table class="table table-hover table-bordered">
		<thead>
			<tr>
				<th> 会员编号 </th>
				<th> 会员名称 </th>
				<th> 会员性别 </th>
				<th> 操作 </th>
			</tr>
		</thead>
		<tbody>
			<foreach name='userInfo' item="value">
				<tr>
					<td>{$value.user_id}</td>
					<td>{$value.u_name}</td>
					<td>{$value.u_gender}</td>
					<td>
						<a href="?m=admin&c=user&a=personOrder&uid={$value.user_id}" class=" btn btn-default ">查看订单</a>
						<a href="?m=admin&c=user&a=update&uid={$value.user_id}" class=" btn btn-info ">编辑</a>
						<a href="?m=admin&c=user&a=deleteUser&uid={$value.user_id}" class=" btn btn-danger "
							onclick="return move()">删除</a>
					</td>
				</tr>
			</foreach>
		</tbody>
	</table>

	<br />
	<br />
</div>

<script type="text/javascript">
	function query() {
		var name = document.getElementById('name').value;
		if (name == '') {
			alert("查询会员名称不能为空!");
			return false;
		}
		return true;
	}

	function move() {
		if (window.confirm("是否要删除该会员")) {
			return true;
		}
		return false;
	}
</script>
<include file="Index/footer" />